import { instance as request } from '../request'

/**
 * 批量创建项目模块
 * @param data
 * @returns
 */
export const createModulesApi = (data: createModulesItf): PromiseRes =>
  request.post('/module/create', data)

/**
 * 修改模块信息
 * @param data
 * @returns
 */
export const updateModuleApi = (data: updateModuleItf): PromiseRes =>
  request.put('/module/update', data)

/**
 * 删除模块
 * @param id 模块id
 * @returns
 */
export const deleteModuleApi = (id: string): PromiseRes =>
  request.delete(`/module/delete/${id}`)

/**
 * 获取项目模块
 * @param projectId 项目id
 * @returns
 */
export const getProjectModulesApi = (
  projectId: string
): PromiseRes<getProjectModulesResItf[]> =>
  request.get(`/module/get/${projectId}`)
